<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>案例</title>
</head>

<body>
  <div class="one">一等奖是</div>
  <div class="two">二等奖是</div>
  <div class="three">三等奖是</div>
  <script>
    const arr = ['张三', '李四', '王五']
    let one = document.querySelector('.one')
    let two = document.querySelector('.two')
    let three = document.querySelector('.three')

    let random1 = Math.floor(Math.random() * arr.length)
    one.innerHTML = one.innerHTML + arr[random1]
    arr.splice(random1, 1)

    let random2 = Math.floor(Math.random() * arr.length)
    two.innerHTML = two.innerHTML + arr[random2]
    arr.splice(random2, 1)

    let random3 = Math.floor(Math.random() * arr.length)
    three.innerHTML = three.innerHTML + arr[random3]
  </script>
</body>

</html>